package com.example;

import com.example.command.Command;
import com.example.command.LoginCommand;
import com.example.command.LogoutCommand;


public class CommandTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		MyConnection myConnection = new MyConnection();
		Command login = new LoginCommand(myConnection);
		Command logout = new LogoutCommand(myConnection);

		CommunicationServer server = new CommunicationServer(login, logout);

		try {
	           if (args[0].equalsIgnoreCase("ON")) {
	        	   server.login();
	           } else if (args[0].equalsIgnoreCase("OFF")) {
	        	   server.logout();
	           } else {
	               System.out.println("Argument \"ON\" or \"OFF\" is required.");
	           }
	       } catch (Exception e){
	           System.out.println("Arguments required.");
	       }
	}

	
}
